import React from 'react'
import { createBrowserRouter } from 'react-router-dom'
import Layout from '../pages/Layout'
import Year from '../pages/Year'
import Month from '../pages/Month'
import New from '../pages/New'
import Error from '../pages/Error'

const router = createBrowserRouter([
	{
		path: '/',
		element: <Layout />,
		children: [
			{
				index: true,
				element: <Month />
			},
			{
				path: 'month',
				element: <Month />
			},
			{
				path: 'year',
				element: <Year />
			}
		]
	},
	{
		path: 'new',
		element: <New />
	},
	{
		path: '*',
		element: <Error />
	}
])

export default router